//!
//! Copyright (c) 2024-2999 北京心月狐科技有限公司 All rights reserved.
//!
//! https://www.mxxshop.com
//!
//! Licensed 并不是自由软件，未经许可不能去掉 MxxShop 相关版权
//!
//! 版权所有，侵权必究！
//!

use minijinja::Error;
use minijinja::value::{Rest, Value};
use crate::utils::time_utils::time_difference;

pub fn format_time(name: &str, args: Rest<String>) -> Result<Value, Error> {

    let mut new_time = String::new();
    if name.is_empty() { 
        new_time = "时间格式错误".to_string();
    }else{
        new_time = time_difference(name);
    }
    Ok(Value::from_safe_string(new_time))
}